#include "StdAfx.h"
#include "SampleMarker.h"

SampleMarker::SampleMarker(void)
{
	index = 0;
	type = UserDefined;
}

SampleMarker::~SampleMarker(void)
{
}

SampleMarker::SampleMarker(unsigned int index, unsigned int endIndex, MarkerType type)
{
	this->index = index;
	this->endIndex = endIndex;
	this->type = type;
}

void SampleMarker::GetRegion(unsigned int from, unsigned int to, std::vector<SampleMarker>& fromMarkers, std::vector<SampleMarker>& toMarkers)
{
	toMarkers.clear();
	for(unsigned int i=0; i<fromMarkers.size(); i++)
	{
		SampleMarker tmpMarker = fromMarkers[i];
		if(tmpMarker.index>=from && tmpMarker.index<=to)
		{
			tmpMarker.index -= from;
			tmpMarker.endIndex -= from;
			toMarkers.push_back(tmpMarker);
		}
	}
}